//
//  LGSAndGate.m
//  LogicSim
//
//  Created by Jeremy Pereira on 04/04/2012.
//  Copyright (c) 2012 Jeremy Pereira. All rights reserved.
//

#import "LGSOrGate.h"
#import "LGSEdge.h"
#import "LGSName.h"

@implementation LGSOrGate

-(void) evaluateAffectedNodes: (NSMutableOrderedSet*) affectedNodes;
{
    bool a = [[self input: [[self class] inputAName]] value];
    bool b = [[self input: [[self class] inputBName]] value];
    bool result = a || b;
    
    NSSet* outputs = [self outputsForName: [[self class] outputName]];
    for (LGSEdge* edge in outputs)
    {
        [edge setValue: result affectedNodes:affectedNodes];
    }
}

-(TimeTick) gateDelay
{
    return 1;
}

@end
